<!-- 邮件订阅 -->
<link type="text/css" rel="stylesheet" href="__ADDONROOT__/Public/subscribe.css?T=88978">
<div class="subscribe_box">
<div class="subscribe_box subscribe_btn" data-toggle="modal" data-target="#mail-subscribe-modal"> 订阅 </div>
</div>
<!-- 模态框HTML -->
<div class="modal fade" id="mail-subscribe-modal">
  <div class="modal-dialog"> 
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 class="modal-title">邮件订阅</h4>
        </div>
        <form id="mail-subscribe" class="form-horizontal" action="{:addons_url('Mail://MailRss/subScribe','',C('DEFAULT_MODULE'))}" method="post">
        <div class="modal-body">
                <input id="email_address" name="email_address" type="text" class="form-control input-lg" placeholder="请填写你的邮箱地址">
        </div>
        <div class="modal-footer">
             <button type="submit" class="btn btn-lg btn-primary" >提交</button>
        </div>
     </form>
  </div>
 </div>
</div>
<script type="text/javascript">

+$(function () {
				
	$("#mail-subscribe").submit(function(){
		var patterns = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
		var email_address = $('#email_address').val();
		if (email_address == '' || !patterns.test(email_address)) {
			$.zui.messager.danger('请输入正确的邮箱格式',{placement:'center'});
			return false;
		}
		var self = $(this);
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;
		function success(data){
			if(data.status){
				$.zui.messager.info(data.info,{placement:'center'});
				$('#email_address').val('');
				$('#mail-subscribe-modal').modal('hide');
			} else {
				$.zui.messager.special(data.info,{placement:'center'});
			}
		}
		
	});

})

</script>

<!-- 邮件订阅 END -->